Report post

What is a comment block in JavaScript?

Any text between /* and */ will be ignored by JavaScript. This example uses a multi-line comment (a comment block) to explain the code: document.getElementById("myP").innerHTML = "My first paragraph."; It is most common to use single line comments. Block comments are often used for formal documentation.

How to comment multiple lines in JavaScript?

To comment multiple lines in JavaScript, use the /* */. Multiple line comments are used to prevent the execution of many lines of code. Javascript multiline comments, also known as block comments, start with a forward slash followed by an asterisk (/*) and end with an asterisk followed by a forward slash (*/).

What are the different types of comments in JavaScript?

Anyway, it has to do with comments in JavaScript. The language supports two comment types: 1. Single line using the double slash: // This is a comment. 2. Multiline (also called block) using the slash-asterisk combination: /* This comment can go over multiple lines. */

What are block-level comments?

Block-level comments, or multi-line comments, are long-form annotations used to introduce and explain a section of code. Often these types of comments are placed at the top of a file, or before a particularly complex code block.

Related articles

The World's Leading Crypto Trading Platform

Get my welcome gifts